<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			window.addEventListener("load", function() {
				var btn = document.querySelector("button");
				btn.addEventListener("click", function() {
					window.alert("xxx");
				})
			})

			window.addEventListener("load", function() {
				alert("lskdjfs");
			})

			window.addEventListener("DOMContentLoaded", function() {
				alert("DOMLoaded");
			})
			//load 等页面内容全部加载完毕,包含页面dom元素 图片 flash css等等 
			//DOMContentLoaded是DOM加载完毕,不包含图片 flash css等就可以执行,加载速度比load要快点
		</script>
	</head>
	<body>
		<button type="button">点击</button>
	</body>
</html>
